package core.role.model;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;


@Entity
@Table(name="basicroles")

public class BasicRoles implements Serializable{
	
		private static final long serialVersionUID = -8767337896773261247L;
		private Long uuid;
		private String roleName ;

		
		Set<BasicRoleRules> basicRoleRules =  new HashSet<BasicRoleRules>();
		@Id
		@GeneratedValue
		@Column(name="uuid")
		public Long getUuid()
		{
			return uuid ;
		}
		
		@ManyToMany(cascade = CascadeType.ALL)
		@JoinTable(name = "basicroles_basicrolerules", joinColumns = {@JoinColumn(name ="basicroles_uuid") }, inverseJoinColumns = {@JoinColumn(name="basicrolerules_uuid")})
		public Set<BasicRoleRules> getBasicRoleRules() {
			return basicRoleRules;
		}
		public void setBasicRoleRules(Set<BasicRoleRules> basicRoleRules) {
			this.basicRoleRules = basicRoleRules;
		}
		
		@Column(name="rolename")
		public String getRoleName() 
		{
			return roleName;
		}
		 
		public void setUuid(Long uuid)
		{
			this.uuid = uuid;
		}
		public void setRoleName(String roleName)
		{
			this.roleName = roleName ;
		}
	
}
